package sieci.powtorka.dwa;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
import java.net.UnknownHostException;

public class Client {

	Socket sc;

	public Client() throws IOException, UnknownHostException {
		super();
		sc = new Socket("127.0.0.1", 4662);
		System.out.println("Client listening...");
		listen();
	}

	private void listen() throws IOException {
		String s;
		BufferedReader br = new BufferedReader(new InputStreamReader(
				sc.getInputStream()));
		while ((s = br.readLine()) != null) {
			System.out.println(s);
		}
		br.close();
	}
}
